"""
@File    :   out.py
@Time    :   2024/04/14 16:31:10
@Author  :   Qrj
@Email   :   923207736@qq.com
@description   :   系统配置相关的序列化模型
"""

from datetime import datetime

from pydantic import BaseModel, Field

from src.schemas.out import BaseOutSchemaConfigMixin


class SystemSettingsCompleteOutSchema(BaseModel, BaseOutSchemaConfigMixin):
    """系统设置完整的序列化模型"""

    id: int = Field(default=..., description="主键")
    min_password_length: int = Field(default=..., description="密码最小长度")
    max_password_length: int = Field(default=..., description="密码最大长度")
    password_strength: str = Field(default=..., description="密码强度要求")
    login_failure_lockout_policy: str = Field(
        default=..., description="登录失败锁定策略"
    )
    login_failure_lockout_times: int = Field(
        default=..., description="登录失败锁定次数"
    )
    login_failure_lock_minutes: int = Field(
        default=..., description="登录失败锁定时间(分钟)"
    )
    # 文件上传相关
    user_avatar_image_upload_max_size: int = Field(
        default=..., description="上传用户头像的最大大小(单位: MB)"
    )
    user_avatar_image_upload_type: list[str] = Field(
        default=..., description="允许上传的用户头像图片格式"
    )
    image_upload_max_size: int = Field(
        default=..., description="上传图片的最大大小(单位: MB)"
    )
    image_upload_type: list[str] = Field(default=..., description="允许上传的图片格式")
    video_upload_max_size: int = Field(
        default=..., description="上传视频的最大大小(单位: MB)"
    )
    video_upload_type: list[str] = Field(default=..., description="允许上传的视频格式")
    file_upload_max_size: int = Field(
        default=..., description="上传文件的最大大小(单位: MB)"
    )
    file_upload_type: list[str] = Field(default=..., description="允许上传的文件格式")
    create_datetime: datetime = Field(default=..., description="创建时间")
    update_datetime: datetime = Field(default=..., description="修改时间")
    creator_username: str = Field(default=..., description="创建者")
    updater_username: str = Field(default=..., description="修改者")
    tenant_id: int = Field(default=..., description="租户ID")
